Skip to contentMethod: computeNextMove(int, FGPlayer, FGState, long)
      1: package de.fhdw.gaming.ipspiel24.fg.strategy;
2: 
3: import java.util.Optional;
4: 
5: import de.fhdw.gaming.ipspiel24.fg.domain.FGPlayer;
6: import de.fhdw.gaming.ipspiel24.fg.domain.FGState;
7: import de.fhdw.gaming.ipspiel24.fg.domain.FGStrategy;
8: import de.fhdw.gaming.ipspiel24.fg.moves.FGMove;
9: import de.fhdw.gaming.ipspiel24.fg.moves.factory.FGMoveFactory;
10: 
11: /**
12:  * Cinema Strategy.
13:  */
14: public class FGCinemaStrategy implements FGStrategy {
15: 
16:     /**
17:      * The factory for creating FG moves.
18:      */
19:     private final FGMoveFactory moveFactory;
20: 
21:     /**
22:      * Creates an {@link FGSayYesStrategy}.
23:      *
24:      * @param moveFactory The factory for creating FG moves.
25:      */
26:     FGCinemaStrategy(final FGMoveFactory moveFactory) {
27:         this.moveFactory = moveFactory;
28:     }
29: 
30:     @Override
31:     public Optional<FGMove> computeNextMove(
32:             final int gameId,
33:             final FGPlayer player,
34:             final FGState state,
35:             final long maxComputationTimePerMove) {
36:         return Optional.of(this.moveFactory.createCinemaMove());
37:     }
38: 
39:     @Override
40:     public String toString() {
41:         return FGCinemaStrategy.class.getSimpleName();
42:     }
43: }